package zzz;

import java.util.Random;
import java.util.Scanner;

class Person{
    public void eat() {
        System.out.println("吃米饭,吃菜");
    }
        public void drink(){
            System.out.println("喝开水");
        }
    }

class Student extends Person{
    @Override//建议方法重写的格式是否正确
    public void eat(){
        System.out.println("吃炸鸡");
    }
    @Override
    public void drink(){
        System.out.println("喝日本生可乐");
    }
   public void lunch(){
       //先在本类中查看eat和drink方法,就会调用子类的,如果没有,就回调用从父类中继承下来的eat和drink方法
       this.eat();
       this.drink();
       //直接调用父类中的
       super.eat();
       super.drink();
   }
}

public class test {
    public static void main(String[] args) {
        Student stu = new Student();
        stu.lunch();
    }
}
